<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="com.vb.webpress.data.*"%>
<%
	int id = Integer.valueOf(request.getParameter("newsid"));
	News news = NewsDAO.findNewsById(id);
	News[] newsArray = NewsDAO.findNewsByType(news.getType_name(), 0, 5);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>News</title>
</head>
<body>
<h2><%=news.getTitle()%></h2>
<p><%=news.getTime() %></p>
<h3><%=news.getContent()%></h3>
</hr>
<table>
	<% for(int j = 0; j < newsArray.length; j++){
					if(newsArray[j] != null && newsArray[j].getId() != id){
				%>
	<tr>
		<td><a
			href=<%="/WebPress/news.jsp?newsid=" + newsArray[j].getId()%>><%=newsArray[j].getTitle()%></a>
		</td>
		<td><%=newsArray[j].getTime().toString().substring(0, 19)%></td>
	</tr>
	<% 	
					}
				}
				%>
</table>
</body>
</html>